Merge "PostgreSQL: Drop three unused columns"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 14 Dec 2018 18:18:12 +0000 (18:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 14 Dec 2018 18:18:12 +0000 (18:18 +0000)
RELEASE-NOTES-1.32
includes/installer/PostgresUpdater.php
maintenance/postgres/tables.sql

index cc250ef..5f034b5 100644 (file)
@@ -662,6 +662,8 @@ because of Phabricator reports.
   should be mediated by the CommentStore class, this change shouldn't affect
   external code.
 * (T206147) Database::close() will no longer commit any open transactions.
+* (T64103) Dropped columns category.cat_hidden, site_stats.ss_admins, and
+  recentchanges.rc_cur_time from the PostgreSQL schema.
 
 == Compatibility ==
 MediaWiki 1.32 requires PHP 7.0.0 or later. Although HHVM 3.18.5 or later is
index 917f589..9ddc85a 100644 (file)
@@ -598,6 +598,9 @@ class PostgresUpdater extends DatabaseUpdater {
                        [ 'addPgField', 'ipblocks', 'ipb_sitewide', 'SMALLINT NOT NULL DEFAULT 1' ],
                        [ 'addTable', 'ipblocks_restrictions', 'patch-ipblocks_restrictions-table.sql' ],
                        [ 'migrateImageCommentTemp' ],
+                       [ 'dropPgField', 'category', 'cat_hidden' ],
+                       [ 'dropPgField', 'site_stats', 'ss_admins' ],
+                       [ 'dropPgField', 'recentchanges', 'rc_cur_time' ],
 
                        // 1.33
                        [ 'dropField', 'change_tag', 'ct_tag', 'patch-drop-ct_tag.sql' ],
@@ -953,8 +956,7 @@ END;
        protected function changeNullableField( $table, $field, $null, $update = false ) {
                $fi = $this->db->fieldInfo( $table, $field );
                if ( is_null( $fi ) ) {
-                       $this->output( "...ERROR: expected column $table.$field to exist\n" );
-                       exit( 1 );
+                       return;
                }
                if ( $fi->isNullable() ) {
                        # # It's NULL - does it need to be NOT NULL?
index 4f636ae..02d018c 100644 (file)
@@ -397,7 +397,6 @@ CREATE TABLE site_stats (
   ss_total_pages    INTEGER            DEFAULT NULL,
   ss_users          INTEGER            DEFAULT NULL,
   ss_active_users   INTEGER            DEFAULT NULL,
-  ss_admins         INTEGER            DEFAULT NULL,
   ss_images         INTEGER            DEFAULT NULL
 );
 
@@ -556,7 +555,6 @@ CREATE SEQUENCE recentchanges_rc_id_seq;
 CREATE TABLE recentchanges (
   rc_id              INTEGER      NOT NULL  PRIMARY KEY DEFAULT nextval('recentchanges_rc_id_seq'),
   rc_timestamp       TIMESTAMPTZ  NOT NULL,
-  rc_cur_time        TIMESTAMPTZ      NULL,
   rc_user            INTEGER      NOT NULL  DEFAULT 0 REFERENCES mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED,
   rc_user_text       TEXT         NOT NULL  DEFAULT '',
   rc_actor           INTEGER      NOT NULL  DEFAULT 0,
@@ -791,8 +789,7 @@ CREATE TABLE category (
   cat_title    TEXT     NOT NULL,
   cat_pages    INTEGER  NOT NULL  DEFAULT 0,
   cat_subcats  INTEGER  NOT NULL  DEFAULT 0,
-  cat_files    INTEGER  NOT NULL  DEFAULT 0,
-  cat_hidden   SMALLINT NOT NULL  DEFAULT 0
+  cat_files    INTEGER  NOT NULL  DEFAULT 0
 );
 ALTER SEQUENCE category_cat_id_seq OWNED BY category.cat_id;
 CREATE UNIQUE INDEX category_title ON category(cat_title);